//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package com.datafactory.Team.mapper;

import com.datafactory.Team.entity.Params;
import com.datafactory.Team.entity.Team;
import com.datafactory.Team.entity.TeamType;
import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

@Mapper
@Repository
public interface TeamMapper {
    @Insert({"INSERT INTO team_registration (team_typeid, team_type, team_name, team_leader, team_ip_address, team_port, team_members, team_capability, is_enabled) VALUES ((SELECT team_typeid FROM team_types WHERE team_type = #{team_type}), #{team_type}, #{team_name}, #{team_leader}, #{team_ip_address}, #{team_port}, #{team_members}, #{team_capability}, #{is_enabled})"})
    int insertTeam(Team team);
    @Insert({"INSERT INTO team_types (team_type) VALUES (#{team_type})"})
    int insertTeamtype(TeamType var1);

    @Select({"select * from team_registration where team_port LIKE CONCAT('%', #{params.team_port}, '%')"})
    List<Team> findBySearch(@Param("params") Params var1);

    @Delete({"delete from team_registration where team_id = #{id}"})
    int delete(int var1);
    @Delete({"delete from team_types where team_typeid = #{id}"})
    int deleteTeamtype(int var1);

    @Select({"select * from team_registration where team_id = #{team_id}"})
    List<Team> findById(Integer var1);
    @Select({"select * from team_types where team_typeid = #{team_typeid}"})
    List<TeamType> findByTypeId(Integer var1);

    @Select({"select * from team_types where team_type LIKE CONCAT('%', #{params.team_type}, '%')"})
    List<TeamType> findBySearchType(@Param("params") Params var1);
    @Update({"UPDATE team_registration SET team_type = #{team_type}, team_name = #{team_name},  team_leader = #{team_leader},  team_ip_address = #{team_ip_address},     team_port = #{team_port},     team_members = #{team_members},     team_capability = #{team_capability},     is_enabled = #{is_enabled} WHERE team_id = #{team_id}"})
    void update(Team var1);
    @Update({"UPDATE team_types SET team_type = #{team_type} WHERE team_typeid = #{team_typeid}"})
    void updateType(TeamType var1);

}
